<template>
  <div>
    <el-form
      :inline="true"
      :model="dataForm"
      @keyup.enter.native="findAll()"
    >
      <el-form-item>
        <el-input v-model="data" placeholder="查询" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-button @click="findAll()">查询</el-button>
      </el-form-item>
    </el-form>
    <el-table border :data="tableData" style="width: 100%">

      <el-table-column header-align="center"
                       align="center" prop="userId" label="用户" width="180"></el-table-column>
      <el-table-column header-align="center"
                       align="center" prop="temp" label="温度" width="180"></el-table-column>
      <el-table-column header-align="center"
                       align="center" prop="hesuan" label="核酸结果" width="180"></el-table-column>
      <el-table-column header-align="center"
                       align="center" prop="tempTime" label="时间" width="200"></el-table-column>

      <el-table-column
        header-align="center"
        align="center"
        width="150"
        label="操作">
        <template slot-scope="scope">
          <el-button v-if="!scope.row.hesuan" type="text" size="small" @click="addOrUpdateHandle(scope.row)">上报核酸结果</el-button>
        </template>
      </el-table-column>
    </el-table>
    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="findAll"></add-or-update>

  </div>
</template>
<script>
  import AddOrUpdate from './notice-add-or-update'

  export default {
    name: "hesuan",
    data() {

      return {
        data: [],
        pageIndex: 1,
        pageSize: 10,
        totalPage: 0,
        addOrUpdateVisible: false,
        tableData: [
        ],
      };
    },components: {
      AddOrUpdate
    },
    mounted() {
      // this.findreqpunchaudit();
      this.findAll();
    },
    methods: {
      addOrUpdateHandle (id) {
        this.addOrUpdateVisible = true
        this.$nextTick(() => {
          this.$refs.addOrUpdate.init(id)
        })
      },


      async getDataList() {
      },
      sizeChangeHandle() {
      },
      currentChangeHandle() {
      },
      async findAll() {
        let result = await this.$API.room.getAllHesuan({
        });
        if (result.data.code === 20000) {

          this.tableData = result.data.data;
        }
      },
    },

  };
</script>
<style scoped></style>
